package com.example.demo.service.ServiceImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.bean.User;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;

/**
 * @author liaoxh
 * @create 2021-06-09-20:07
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User>implements UserService {
    @Autowired
    UserService userService;
    @Override
    public User getByName(String name) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("name", name);
        User user = userService.getOne(wrapper);
        return user;
    }
}
